<?php
namespace App\Controllers\Common;

/**
*	基础action
*/
class Base extends \App\Libs\Base\BaseAction
{
	public $page = 1;//当前页
	public $size = 10;//每页展示条数
	public $offset = 0;//偏移量
	 protected function beforeRun() {
		parent::beforeRun();
//        $this->needLogin = TRUE;
    }
	protected function beforeExecute(){
		parent::beforeExecute();
		$page  = (int)$this->request->get("page");//页数
		$size = (int)$this->request->get("size");//展示数量 
		if( !empty( $page ) ){
			$this->page = $page;
		}
		if( !empty( $size ) ){
			$this->size = $size;
		}
		$this->offset = ( $this->page - 1 ) * $this->size;
	}
    protected function execute() {
		return parent::execute();
    }
}
